package br.unb.graphics.actions;

import br.unb.graphics.GraphicInterface;
import br.unb.graphics.help.OpenBrowser;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.JOptionPane;

/**
 *
 * @author spider
 */
public class HelpAction extends AbstractAction {

    private OpenBrowser browser;
    private boolean[] isOnScreen;
    private String[] isOnScreenName;
    public static final String helpAction = "help";

    public HelpAction() {
        super(helpAction);
    }

    public void actionPerformed(ActionEvent e) {
        for (int i = 0; i < 10; i++) {
            if (isOnScreen[i]) {
                if (GraphicInterface.getInstance().tabs.getComponent(i) != null) {
                    if (GraphicInterface.getInstance().tabs.getComponent(i).isShowing()) {
                        if (isOnScreenName[i] != null) {
                            browser.OpenHelp(isOnScreenName[i] + "/" + isOnScreenName[i] + ".html");
                        } else {
                            JOptionPane.showMessageDialog(null, "can't find help to this tab");
                        }
                    }
                }
            }
        }
    }
}

/*

class HelpAction extends AbstractAction {



class PortuguesAction extends AbstractAction {

PortuguesAction() {
super(portuguesAction);
}

public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(null, "portugues");
}
}

class EnglishAction extends AbstractAction {

EnglishAction() {
super(englishAction);
}

public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(null, "english");
}
}
 */
